package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.WxBannerConfigMapper;
import com.ruoyi.business.domain.WxBannerConfig;
import com.ruoyi.business.service.IWxBannerConfigService;

/**
 * 广告图配置Service业务层处理
 * 
 * @author asher
 * @date 2021-11-12
 */
@Service
public class WxBannerConfigServiceImpl implements IWxBannerConfigService 
{
    @Autowired
    private WxBannerConfigMapper wxBannerConfigMapper;

    /**
     * 查询广告图配置
     * 
     * @param bannerId 广告图配置主键
     * @return 广告图配置
     */
    @Override
    public WxBannerConfig selectWxBannerConfigByBannerId(Long bannerId)
    {
        return wxBannerConfigMapper.selectWxBannerConfigByBannerId(bannerId);
    }

    /**
     * 查询广告图配置列表
     * 
     * @param wxBannerConfig 广告图配置
     * @return 广告图配置
     */
    @Override
    public List<WxBannerConfig> selectWxBannerConfigList(WxBannerConfig wxBannerConfig)
    {
        return wxBannerConfigMapper.selectWxBannerConfigList(wxBannerConfig);
    }

    /**
     * 新增广告图配置
     * 
     * @param wxBannerConfig 广告图配置
     * @return 结果
     */
    @Override
    public int insertWxBannerConfig(WxBannerConfig wxBannerConfig)
    {
        wxBannerConfig.setCreateTime(DateUtils.getNowDate());
        return wxBannerConfigMapper.insertWxBannerConfig(wxBannerConfig);
    }

    /**
     * 修改广告图配置
     * 
     * @param wxBannerConfig 广告图配置
     * @return 结果
     */
    @Override
    public int updateWxBannerConfig(WxBannerConfig wxBannerConfig)
    {
        wxBannerConfig.setUpdateTime(DateUtils.getNowDate());
        return wxBannerConfigMapper.updateWxBannerConfig(wxBannerConfig);
    }

    /**
     * 批量删除广告图配置
     * 
     * @param bannerIds 需要删除的广告图配置主键
     * @return 结果
     */
    @Override
    public int deleteWxBannerConfigByBannerIds(Long[] bannerIds)
    {
        return wxBannerConfigMapper.deleteWxBannerConfigByBannerIds(bannerIds);
    }

    /**
     * 删除广告图配置信息
     * 
     * @param bannerId 广告图配置主键
     * @return 结果
     */
    @Override
    public int deleteWxBannerConfigByBannerId(Long bannerId)
    {
        return wxBannerConfigMapper.deleteWxBannerConfigByBannerId(bannerId);
    }
}
